<template>
	<view class="content">
		<image class="banner" src="../../static/img/banner.png" mode="widthFix"></image>
		<view class="ticketList">
			<!-- 测试票 -->
			<view class="ticketItem" @click="ticketClick('cs')">
				<view class="ticketContent">
					<view class="itemImg">
						<image src="../../static/img/jl.png" mode="heightFix"></image>
					</view>
					<view class="ticketName">清东陵-小程序测试</view>
				</view>
			</view>
			
			<view class="ticketItem" @click="ticketClick('zh')">
				<view class="ticketContent">
					<view class="itemImg">
						<image src="../../static/img/jl.png" mode="heightFix"></image>
					</view>
					<view class="ticketName">清东陵-组合票</view>
				</view>
			</view>
			<view class="ticketItem" @click="ticketClick('ggc')">
				<view class="ticketContent">
					<view class="itemImg">
						<image src="../../static/img/jl.png" mode="heightFix"></image>
					</view>
					<view class="ticketName">清东陵-观光车</view>
				</view>
			</view>
			<view class="ticketItem" @click="ticketClick('yl')">
				<view class="ticketContent">
					<view class="itemImg">
						<image src="../../static/img/yl.jpg" mode="heightFix"></image>
					</view>
					<view class="ticketName">清东陵-裕陵</view>
				</view>
			</view>
			<view class="ticketItem" @click="ticketClick('ddl')">
				<view class="ticketContent">
					<view class="itemImg">
						<image src="../../static/img/ddl.png" mode="heightFix"></image>
					</view>
					<view class="ticketName">清东陵-定东陵</view>
				</view>
				
			</view>
			<view class="ticketItem" @click="ticketClick('jl')">
				<view class="ticketContent">
					<view class="itemImg">
						<image src="../../static/img/jl.png" mode="heightFix"></image>
					</view>
					<view class="ticketName">清东陵-景陵</view>
				</view>
				
			</view>
			<view class="ticketItem" @click="ticketClick('xl')">
				<view class="ticketContent">
					<view class="itemImg">
						<image src="../../static/img/xl.png" mode="heightFix"></image>
					</view>
					<view class="ticketName">清东陵-孝陵</view>
				</view>
			</view>
		</view>
		
		<view class="tabBar">
			<view class="tabItem">
				<image src="../../static/img/home_icon.png" mode="heightFix"></image>
				<view class="active">首页</view>
			</view>
			<view class="tabItem" @click="userClick">
				<image src="../../static/img/user_icon_no.png" mode="heightFix"></image>
				<view>我的</view>
			</view>
		</view>
	</view>
	
	
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		onLoad() {
			
		},
		methods: {
			userClick(){
				uni.redirectTo({
					url: '/pages/order/order'
				})
			},
			ticketClick(e){
				let ticketGroupNum;
				if(e=='zh'){
					ticketGroupNum = 'TGN20231228220213019'
				}else if(e == 'ggc'){
					ticketGroupNum = 'TGN20231218083323187'
				}else if(e == 'yl'){
					ticketGroupNum = 'TGN20231218083305399'
				}else if(e == 'ddl'){
					ticketGroupNum = 'TGN20231225095837952'
				}else if(e == 'jl'){
					ticketGroupNum = 'TGN20231225095856919'
				}else if(e == 'xl'){
					ticketGroupNum = 'TGN20231225095917174'
				}else if(e == 'xl'){
					ticketGroupNum = 'TGN20231225095917174'
				}else if(e == 'cs'){
					ticketGroupNum = 'TGN20231225095940727';
				}
				
				uni.navigateTo({
					url: '/pages/ticket/ticketList?ticketGroupNum=' + ticketGroupNum
				})
			}
		}
	}
</script>

<style>
	.content {
		min-height: 100vh;
		background-color: #f5f5f5;
		padding-bottom: 150rpx;
	}
	.banner{
		width: 100%;
	}
	
	.ticketList{
		box-sizing: border-box;
		width: 100%;
		display: flex;
		flex-wrap: wrap;
		justify-content: flex-start;
		align-items: flex-start;
	}
	.ticketItem{
		box-sizing: border-box;
		width: 50%;
		padding: 20rpx;
	}
	.ticketContent{
		box-sizing: border-box;
		border-radius: 10rpx;
		overflow: hidden;
		box-shadow: 0 0 10rpx #ddd;
		background-color: #fff;
	}
	.ticketItem .itemImg{
		width: 100%;
		height: 300rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		overflow: hidden;
	}
	.ticketItem .itemImg image{
		height: 300rpx;
	}
	.ticketItem .ticketName{
		padding: 20rpx 10rpx;
		background-color: #fff;
		font-size: 28rpx;
		color: #000;
	}
</style>
